/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bs.Beans;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Bone
 */
@Entity
@Table(name = "ponto_abono_utilizacao")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PontoAbonoUtilizacao.findAll", query = "SELECT p FROM PontoAbonoUtilizacao p")})
public class PontoAbonoUtilizacao implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Integer id;
    @Column(name = "DATA_UTILIZACAO")
    @Temporal(TemporalType.DATE)
    private Date dataUtilizacao;
    @Lob
    @Column(length = 65535)
    private String observacao;
    @JoinColumn(name = "ID_PONTO_ABONO", referencedColumnName = "ID", nullable = false)
    @ManyToOne(optional = false)
    private PontoAbono idPontoAbono;

    public PontoAbonoUtilizacao() {
    }

    public PontoAbonoUtilizacao(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getDataUtilizacao() {
        return dataUtilizacao;
    }

    public void setDataUtilizacao(Date dataUtilizacao) {
        this.dataUtilizacao = dataUtilizacao;
    }

    public String getObservacao() {
        return observacao;
    }

    public void setObservacao(String observacao) {
        this.observacao = observacao;
    }

    public PontoAbono getIdPontoAbono() {
        return idPontoAbono;
    }

    public void setIdPontoAbono(PontoAbono idPontoAbono) {
        this.idPontoAbono = idPontoAbono;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PontoAbonoUtilizacao)) {
            return false;
        }
        PontoAbonoUtilizacao other = (PontoAbonoUtilizacao) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.bs.Beans.PontoAbonoUtilizacao[ id=" + id + " ]";
    }
    
}
